Skip to content

feat: add Java dynamic dedup agent#180

Open
officialasishkumar wants to merge 7 commits intokeploy:mainfrom
officialasishkumar:codex/java-dynamic-dedup
Open

feat: add Java dynamic dedup agent#180
officialasishkumar wants to merge 7 commits intokeploy:mainfrom
officialasishkumar:codex/java-dynamic-dedup

Conversation

@officialasishkumar
Copy link
Copy Markdown
Member

@officialasishkumar officialasishkumar commented Apr 23, 2026

Related Issue

  • keploy/enterprise#1920

Related PRs

Closes: NA

Describe the changes you've made

Rewrites the Java SDK repo to be dedup-only. The old record/test/grpc/integration SDK modules are deleted; the remaining published module is keploy-sdk for Java dynamic dedup replay support.

  • Adds KeployDedupAgent for Enterprise dynamic dedup using /tmp/coverage_control.sock and /tmp/coverage_data.sock.
  • Handles per-testcase START <test-set>/<test-id> by resetting JaCoCo counters.
  • Handles matching END <test-set>/<test-id> by dumping/resetting JaCoCo execution data, analyzing app classes, publishing {id, executedLinesByFile}, and ACKing Enterprise.
  • Keeps replay fast by caching class metadata, prioritizing explicit class dirs, and avoiding broad classpath fallback unless KEPLOY_JAVA_CLASSPATH_FALLBACK=true is set.
  • Keeps the servlet middleware only as a lifecycle hook for javax.servlet; Jakarta/Spring Boot 3 and non-servlet apps can call KeployDedupAgent.start() directly.
  • Updates the README to describe the SDK as dedup-only, including native, Docker, and restricted Docker socket requirements.
  • Simplifies the Maven workflow to build the remaining dedup SDK module.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How did you test your code changes?

  • mvn -B -DskipTests clean verify -pl keploy-sdk -am on JDK 8.
  • mvn -B -DskipTests clean verify -pl keploy-sdk -am on JDK 17.
  • mvn -B -DskipTests clean verify -pl keploy-sdk -am on JDK 21.
  • git diff --check.
  • Validated with the samples-java/java-dedup app against 1000 committed replay fixtures: 1000 successes, 0 failures across four testsets.

No unit tests were added by request; validation is build and replay coverage.

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

Java dedup requires JaCoCo TCP server mode during replay. Docker and restricted Docker modes require the Enterprise and application containers/processes to share /tmp so the control/data Unix sockets are visible.

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas and used java doc.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Screenshots (if any)

NA

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
@officialasishkumar officialasishkumar marked this pull request as ready for review April 23, 2026 16:41
@officialasishkumar
Copy link
Copy Markdown
Member Author

Upstream tracking issue: keploy/enterprise#1920

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
@officialasishkumar officialasishkumar force-pushed the codex/java-dynamic-dedup branch from 3cf90c9 to 67ac32b Compare April 24, 2026 07:44
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant